package tree;

import java.util.ArrayList;
import java.util.List;

import entity.TreeNode;

public class DFSTree {
	
	public static void navigate(TreeNode root, List<Object> result){
		
		if(root == null) return;
		result.add(root.data);
		if(root.left != null)
			navigate(root.left, result);
		if(root.right != null)
			navigate(root.right, result);
	}

	public static void main(String[] args) {
		
		// String preOrder = "124##57###36#89#";
		String preOrder = "13##42#";
		TreeNode root = PreOrderBuildTree.buildTree(preOrder);
		
		List<Object> result = new ArrayList<Object>();
		navigate(root, result);
		
		System.out.println("hold");
	}
	
}
